package cn.ulyer.common.utils;

import cn.ulyer.common.model.PageableVo;

public class PageUtil extends cn.hutool.core.util.PageUtil {

    static {
        setOneAsFirstPageNo();
    }

    public static String pageSql(String originalSql, PageableVo pageableVo){
        return originalSql + " limit "+ getStart(pageableVo.getCurrent(),pageableVo.getSize()) + "," + pageableVo.getSize();
    }

    public static String countSql(String originalSql){
        return "select count(*) from ("+originalSql+") t";
    }


}
